package com.yoga.api;

import com.yoga.model.DashboardSummaryVO;
import com.yoga.service.DashboardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author yan
 * @date 2025/8/18
 */
@RestController
@RequestMapping(value = "/api/v1/charts", produces = MediaType.APPLICATION_JSON_VALUE)
public class ChartsApi {
        @Autowired
        private DashboardService dashboardService;

        // 汇总数据
        @GetMapping("/summary")
        public DashboardSummaryVO getSummary() {
            return dashboardService.getSummary();
        }

        // 近7天课程预约趋势
        @GetMapping("/courseTrend")
        public Map<String, Object> getCourseTrend() {
            return dashboardService.getCourseTrend();
        }

        //课程预约数
        @GetMapping("/all")
        public Map<String, Object> getAll() {
            return dashboardService.getAll();
        }
}
